package controller;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import view.HomeScreen;
import view.templates.MyJButton;

public class HomeScreenListener implements ActionListener {
	private Controller controller = null;
	private HomeScreen homeScreen = null;

	public HomeScreenListener(Controller controller) {
		this.controller = controller;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		this.homeScreen = controller.getFrame().getHomeScreen();

		if (e.getSource().getClass() == MyJButton.class) {
			MyJButton b = (MyJButton) e.getSource();
			if (b == homeScreen.getNewWorkoutPlan()) {
				controller.getFrame().initNewWorkoutScreen0();
			} else if (b == homeScreen.getButton2()) {
				System.err.println("Button 2");
			}
		}
	}
}
